#ifndef GLO_PD_H
#define GLO_PD_H
#include <mpi.h>
//home/00292431309/Desktop/mpich-1.2.7p1/include/mpi.h"
//#include "/usr/lib/mpich/include/mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include "types.h"
#include <time.h>


//USAGE: Application must implement all four methods below


//application's task initialization
int PD_Init(int argc, char *argv[], int rank, int neighc, int *neighv);
/*Params: 

IN:
1) argc and argv are params passed by command line to the application; 
2) rank means the number of the process in the MPI environment. Process are from 0 to N-1 where N means the number of processes used by MPI's comand -np; 
3) neighc means the number of neighbours specified by the file graph.txt;
4) neighv is the vector containing the neighbours of the node which were specified by graph.txt. If, for example, there are 4 processes and the graph.txt is:
	2
	0 1
        1 3 

so to process 1 neighc is 2 and neighv is {0,3}. 

OUT:
5) return: not used yet
*/

int PD_Pulse(int l, int *msgc, int **destv, void **msgv, int **index_type_msgv);
//application's task computation

int PD_Event(void *msg, int index_type, int sender);


//application's task memory allocation
int PD_Msg_buff_allocate(int size, int neigh, void *buff);
/*Used to allocate memory to store incoming messages. 
Params:

IN:
1) size is the memory amount necessary to receive the message through the channel
2) neigh is the neighbour from which the message will be received

OUT:
3) buff is the pointer to be allocated
4) return: not used yet

*/




//application's task free method
int PD_Finalize();
/*Used in the end of the computation in order to release memory used in the application
Param:
1) return: not used yet

*/



#endif
